package com.laboratory.report.lab04.lab0403;

import java.io.File;

/**
 * 测试
 */
public class Lab0403Main {

    public static void main(String[] args) {
        File file = new File("D:\\冬奥会");
        if(file.exists()) {
            deleteDir(file);
        }
    }

    private static void deleteDir(File dir) {
        if(dir.isFile()) {
            return;
        }
        File[] files = dir.listFiles();
        for(File file : files) {
            if(file.isFile()) {
                file.delete();
                continue;
            }
            deleteDir(file);
        }
        dir.delete();
    }
}
